﻿using System;
using Microsoft.TV2.Tools;

namespace UDS.DB.SP1
{
    internal class CmdArgs : ICmdArgs
    {
        [Arg("apply", "To apply the service pack 1 of the DB.")]
        public bool ApplySP1
        {
            get;
            private set;
        }

        [Arg("server", "s", Description = "Use this option to override the database server name specified in config file.", Required = false, RequiredValue = ArgRequiredValue.Yes)]
        public string Server
        {
            get;
            private set;
        }

        #region ICmdArgs Members
        public bool ShowUsage
        {
            get;
            set;
        }

        public void Usage(string errorInfo)
        {
            if (!string.IsNullOrEmpty(errorInfo))
            {
                Console.WriteLine();
                Console.WriteLine(errorInfo);
                Console.WriteLine();
            }
            Console.WriteLine("Usage:");
            Console.WriteLine(ArgParser.Usage(this));
        }

        public void Validate()
        { }

        public void ProcessStandAloneArgument(string arg)
        {
            throw new InvalidArgException(arg);
        }
        #endregion ICmdArgs Members
    }
}
